void main() {
  // 准备购物车数据
  List carts = [
    {"count": 2, "price": 10.0, "selected": true},
    {"count": 1, "price": 30.0, "selected": false},
    {"count": 5, "price": 20.0, "selected": true}
  ];
// 需求：计算购物车中已勾选的商品总价格
  double total = 0.0;
  for (var item in carts) {
    if (item['selected']) {
      total += item['count'] * item['price'];
    }
  }
  print("商品总价：$total￥");
}
